package cn.exrick.controller;

import cn.exrick.pojo.TbMemberVipRule;
import cn.exrick.pojo.common.DataTablesResult;
import cn.exrick.pojo.common.Result;
import cn.exrick.service.MemberVipRuleService;
import cn.exrick.utils.ResultUtil;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wm
 * @date 2019/1/7
 */
@RestController
@Api(description= "会员套餐")
public class MemberVipRuleController {

    @Autowired
    private MemberVipRuleService memberVipRuleService;

    @RequestMapping(value = "/member/viprule/list",method = RequestMethod.GET)
    public DataTablesResult getList(){
        DataTablesResult result = new DataTablesResult();
        result.setData(memberVipRuleService.queryAll());
        return result;
    }

    @RequestMapping(value = "/member/viprule/update",method = RequestMethod.POST)
    public Result<Object> updateFeedbackCat(@ModelAttribute TbMemberVipRule tbMemberVipRule){
        memberVipRuleService.update(tbMemberVipRule);
        return new ResultUtil<Object>().setData(null);
    }

}
